package memcache;

import com.danga.MemCached.MemCachedClient;

public class MemcacheMain {

	public static void main(String[] args) {
		
		MemCachedClient mc = MemCachedClientFactory.getInstance();
		//创建一个缓存
		mc.set("ssm_session", "Hello memcache!");
		//通过key获取缓存对象
		String value = (String) mc.get("ssm_session");
		System.out.println("set:"+value);
		
		//通过key删除一个缓存
		String key = "ssm_session";  
		mc.delete(key);
		//通过key获取缓存对象
		value = (String) mc.get("ssm_session");
		System.out.println("del:"+value);
		
		//获取多个缓存对象
//		MemCachedClient mc = new MemCachedClient();  
//		String[] keys = { "key", "key1", "key2" };  
//		Map<Object> values = mc.getMulti(keys);  
		
		//刷新全部缓存
//		mc.flushAll();
	}

}